Repository navigation
Add runtime docstrings to stubs in release wheels - #1274
Conversation
Thank you so much for the disclosure, @jonathanberthias ! I'm assuming you reviewed the changes already, correct? |
I ran the build workflow on my fork and it seems to work, but I know very little about |
|
Hey @jonathanberthias , simplified the code a bit. I'm now running the wheels and will merge if they pass. Locally, it's working on my Mac, it's very useful! |
|
Everything is passing, can you check on your machine if it's working as well, please? @jonathanberthias https://github.com/scipopt/PySCIPOpt/actions/runs/40122535454 |
|
Why is this done in the repair-wheel phase? Shouldn't this be done in the normal wheel building phase? |
It could also run during the normal build, though that would require some customization of the setuptools build phase. The cibuildwheel hook seemed simpler since this is only needed for release wheels. Maybe there is a better way 🤷 |
|
Why would it only be needed for the PyPI wheels? With the current solution, won't the stubs be missing docstrings in the conda-forge packaging of PySCIPopt, for example? |
The bundled type stubs contain no docstrings, so editors using them can miss the documentation available on the compiled extension.
This PR copies existing runtime docstrings into the stubs during release wheel builds using docstring-adder. It runs after native libraries are bundled and repacks the wheel with updated file hashes. This applies to Python 3.10 and later, as required by docstring-adder.
The implementation was generated with AI assistance.
Part of #1072